package com.nali.spreader.dao.impl;

import com.nali.spreader.dao.ICrudContentReplayDao;
import com.nali.spreader.data.ContentReplay;
import com.nali.spreader.data.ContentReplayExample;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class CrudContentReplayDao implements ICrudContentReplayDao {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 02 15:54:40 CST 2012
     */
    public CrudContentReplayDao() {
        super();
    }

    /**
     * This field was generated by Apache iBATIS ibator.
     * This field corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    @Autowired
    private SqlMapClientTemplate sqlMap;

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public int countByExample(ContentReplayExample example) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("spreader_tb_content_replay.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public int deleteByExample(ContentReplayExample example) {
        int rows = getSqlMapClientTemplate().delete("spreader_tb_content_replay.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public int deleteByPrimaryKey(Long id) {
        ContentReplay key = new ContentReplay();
        key.setId(id);
        int rows = getSqlMapClientTemplate().delete("spreader_tb_content_replay.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public Long insert(ContentReplay record) {
        Object newKey = getSqlMapClientTemplate().insert("spreader_tb_content_replay.ibatorgenerated_insert", record);
        return (Long) newKey;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public Long insertSelective(ContentReplay record) {
        Object newKey = getSqlMapClientTemplate().insert("spreader_tb_content_replay.ibatorgenerated_insertSelective", record);
        return (Long) newKey;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    @SuppressWarnings("unchecked")
    public List<ContentReplay> selectByExample(ContentReplayExample example) {
        List<ContentReplay> list = getSqlMapClientTemplate().queryForList("spreader_tb_content_replay.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public ContentReplay selectByPrimaryKey(Long id) {
        ContentReplay key = new ContentReplay();
        key.setId(id);
        ContentReplay record = (ContentReplay) getSqlMapClientTemplate().queryForObject("spreader_tb_content_replay.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public int updateByExampleSelective(ContentReplay record, ContentReplayExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_content_replay.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public int updateByExample(ContentReplay record, ContentReplayExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_content_replay.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public int updateByPrimaryKeySelective(ContentReplay record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_content_replay.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public int updateByPrimaryKey(ContentReplay record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_content_replay.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    public SqlMapClientTemplate getSqlMapClientTemplate() {
        return sqlMap;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table spreader.tb_content_replay
     *
     * @ibatorgenerated Mon Jul 09 11:42:54 CST 2012
     */
    private static class UpdateByExampleParms extends ContentReplayExample {

        private Object record;

        public UpdateByExampleParms(Object record, ContentReplayExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}
